<template>
  <div class="charts">
    <v-chart :option="getOptions()"></v-chart>
  </div>
</template>

<script setup lang="ts">
import * as echarts from "echarts";
const getOptions = () => {
  return {
    xAxis: {
      show: false,
      max: 100,
      min: 0,
    },
    yAxis: {
      show: false,
      type: "category",
    },
    series: {
      type: "bar",
      data: [33],
      barWidth: 10,
      itemStyle: {
        color: "lightblue",
      },
      backgroundStyle: {
        color: "#ccc",
      },
      showBackground: true,
      label: {
        show: true,
        //文字位置
        position: "right",
        //自定义数值
        formatter: "|",
        color: "yellowgreen",
      },
    },
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "cross",
      },
    },
    grid: {
      left: 0,
      top: 0,
      right: 0,
      bottom: 0,
    },
  };
};
</script>

<style scoped>
.charts {
  width: 100%;
  height: 100%;
  padding-bottom: 10px;
}
</style>